package com.bjx.file.service;

import com.bjx.file.domain.vo.FileVO;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletResponse;

/**
 * @desc: 文件业务接口
 * @author: liushuai
 * @date: 2023/5/15 14:57
 */
public interface FileService {

    /**
     * 单个文件上传接口
     * @param file
     * @param open
     * @return: com.bjx.file.domain.vo.FileVO
     * @Author: liushuai
     * @Date: 2023/5/16 21:28
     */
    FileVO upload(MultipartFile file,Boolean open);
   /**
    * 根据文件存储的url获取文件预览url
    * @param url
    * @param open
    * @return: com.bjx.file.domain.vo.FileVO
    * @Author: liushuai
    * @Date: 2023/5/15 18:27
    */
    FileVO preview(String url,Boolean open);

    /**
     * 根据文件存储的url下载文件
     * @param httpServletResponse
     * @param url
     * @param open
     * @Author: liushuai
     * @Date: 2023/5/16 21:42
     */
    void download(HttpServletResponse httpServletResponse, String url, Boolean open);

    /**
     * 根据文件存储的url删除文件
     * @param url
     * @param open
     * @Author: liushuai
     * @Date: 2023/5/16 21:56
     */
    void delete(String url, Boolean open);
}
